package com.etoak.car.service;

import com.etoak.car.bean.Comment;
import com.etoak.car.bean.vo.CommentReq;
import com.etoak.car.bean.vo.CommentResp;
import com.etoak.car.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {

    @Autowired
    CommentMapper commentMapper;
    public int userCommentAdd(Comment comment) {
        return commentMapper.userCommentAdd(comment);
    }

    public Comment isFirst(int userid, int carid) {
        return commentMapper.isFirst(userid,carid);
    }

    public List<CommentResp> getAllComment() {
        return commentMapper.getAllComment();
    }

    public int huiComment(CommentReq comment) {
        return commentMapper.huiComment(comment);
    }

    public int delComment(int id) {
        return commentMapper.delComment(id);
    }

    public List<CommentResp> querySomeComment(int id) {
        return commentMapper.querySomeComment(id);
    }
}
